package mypackge;

public class Line {
    public Point point1,point2;// line
    public Line (Point point1,Point point2)
    {
        this.point1=point1;
        this.point2=point2;
    }
    public double length ()
    {
        double a=point2.x-point1.x;
        double b=point2.y-point1.y;
        return Math.sqrt (a*a+b*b);
    }
    public String toString ()
    {
        return "one line, start" + point1.toString () + ", end" + point2.toString () + ", length" + String.format ("%1.2f", length ());
    }



    public static void main (String [] args)
    {
        Point point1=new Point (), point2=new Point (40, 30);
        System.out.println (new Line (point1,point2));
    }


}
